from rest_framework.serializers import ModelSerializer
from ThreePayment.models import Order, Goods, OrderItem


class GoodsListSer(ModelSerializer):
    class Meta:
        model = Goods
        fields = "__all__"


class OrderSer(ModelSerializer):
    class Meta:
        model = Order
        fields = "__all__"


class OrderItemSer(ModelSerializer):
    goods = GoodsListSer()
    class Meta:
        model = OrderItem
        fields = "__all__"